import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import './plugins/element.js'
import 'element-ui/lib/theme-chalk/index.css';

// 导入进度条
// import NProgress from 'nprogress'
// 导入全局样式表
import './assets/css/global.css'
// 导入字体图标样式
import './assets/fonts/iconfont.css'

// import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1'
Vue.prototype.$http = axios
axios.interceptors.request.use(config => {
  // 在发起请求的时候触发进度条
  NProgress.start();
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
axios.interceptors.response.use(config => {
  // 在响应时隐藏进度条
  NProgress.done();
  return config
})

Vue.config.productionTip = false

new Vue({
  axios,
  router,
  render: h => h(App)
}).$mount('#app')
